<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.servletContext.contextPath}" />
<!doctype html>
<html lang="nl">
<head>
	<title>Wijnhuis website</title>
	<link rel="stylesheet" href="${contextPath}/styles/default.css" />
</head>
<c:import url="/WEB-INF/JSP/menu.jsp"></c:import>
<body>
	<h1>Mandje</h1>
	<table>
		<thead>
			<tr>
				<th colspan="3">Wijn</th>
				<th>Prijs</th>
				<th>Aantal</th>
				<th>Te betalen</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<th colspan="6" align="right">Totaal: ${som } Euro</th>
			</tr>
		</tfoot>
		<tbody>
			<c:forEach items="${bestellingen }" var="bestelling">
				<tr>
					<td>${bestelling.land.naam }</td>
					<td>${bestelling.soort.naam }</td>
					<td>${bestelling.wijn.jaar }</td>
					<td align="right">${bestelling.wijn.prijs }</td>
					<td align="right">${bestelling.aantal }</td>
					<td align="right">${bestelling.wijn.prijs * bestelling.aantal }</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<c:url value="/wijnen/mandje.htm" var="bestelURL"/>
	<form action="${bestelURL }" method="post">
	
		<span>Naam<input name="naam" value="${param.naam}" autofocus/></span>
		<span>Straat<input name="straat" value="${param.straat}"/></span>
		<span>Huisnummer<input name="huisNr" value="${param.huisNr}"/></span>
		<span>Postcode<input name="postcode" value="${param.postcode}"/></span>
		<span>Gemeente<input name="gemeente" value="${param.gemeente}"/></span>
		
		
		<div>
			<label> <input type="radio" name="bestelMethode" value="AFHALEN"	${param.bestelMethode=='AFHALEN' ? 'checked' : ''} />Afhalen</label>
		</div>
		<div>
			<label> <input type="radio" name="bestelMethode" value="OPSTUREN" ${param.bestelMethode=='OPSTUREN' ? 'checked' : ''} />Opsturen</label>
		</div>
		
	
	
	
		<input type="submit" value="Als bestelbon bevestigen" id=""/>
	</form>	
	<c:import url="/WEB-INF/JSP/fouten.jsp"></c:import>
</body>
</html>